package com.baosight.risk.service.xtzy.entity;

import com.baosight.risk.base.entity.BaseEntity;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * Table: T_XTZY_USER
 */
@Data
@Table(name = "T_XTZY_USER")
public class XtzyUser extends BaseEntity {

    /**
     * 员工编码
     * <p>
     * Table:     T_XTZY_USER
     * Column:    USER_CODE
     * Nullable:  false
     */
    @Column(name = "USER_CODE")
    private String userCode;

    /**
     * 员工姓名
     * <p>
     * Table:     T_XTZY_USER
     * Column:    USER_DESC
     * Nullable:  true
     */
    @Column(name = "USER_DESC")
    private String userDesc;

    /**
     * 证件类型
     * <p>
     * Table:     T_XTZY_USER
     * Column:    IDCARD_TYPE
     * Nullable:  true
     */
    @Column(name = "IDCARD_TYPE")
    private String idcardType;

    /**
     * 证件类型说明
     * <p>
     * Table:     T_XTZY_USER
     * Column:    IDCARD_TYPE_NAME
     * Nullable:  true
     */
    @Column(name = "IDCARD_TYPE_NAME")
    private String idcardTypeName;

    /**
     * 证件号
     * <p>
     * Table:     T_XTZY_USER
     * Column:    IDCARD_NO
     * Nullable:  true
     */
    @Column(name = "IDCARD_NO")
    private String idcardNo;

    /**
     * 性别
     * <p>
     * Table:     T_XTZY_USER
     * Column:    SEX_TYPE
     * Nullable:  true
     */
    @Column(name = "SEX_TYPE")
    private String sexType;

    /**
     * 出生日期
     * <p>
     * Table:     T_XTZY_USER
     * Column:    BIRTHDAY
     * Nullable:  true
     */
    @Column(name = "BIRTHDAY")
    private Date birthday;

    /**
     * 入职日期
     * <p>
     * Table:     T_XTZY_USER
     * Column:    ENTRY_DATE
     * Nullable:  true
     */
    @Column(name = "ENTRY_DATE")
    private Date entryDate;

    /**
     * 离职日期
     * <p>
     * Table:     T_XTZY_USER
     * Column:    DEPART_DATE
     * Nullable:  true
     */
    @Column(name = "DEPART_DATE")
    private Date departDate;

    /**
     * 办公电话
     * <p>
     * Table:     T_XTZY_USER
     * Column:    TELEPHONE
     * Nullable:  true
     */
    @Column(name = "TELEPHONE")
    private String telephone;

    /**
     * 手机号码
     * <p>
     * Table:     T_XTZY_USER
     * Column:    PHONE_CODE
     * Nullable:  true
     */
    @Column(name = "PHONE_CODE")
    private String phoneCode;

    /**
     * 邮箱地址
     * <p>
     * Table:     T_XTZY_USER
     * Column:    EMAIL
     * Nullable:  true
     */
    @Column(name = "EMAIL")
    private String email;

    /**
     * 政治面貌
     * <p>
     * Table:     T_XTZY_USER
     * Column:    PARTY
     * Nullable:  true
     */
    @Column(name = "PARTY")
    private String party;

    /**
     * 岗位职务
     * <p>
     * Table:     T_XTZY_USER
     * Column:    DUTY
     * Nullable:  true
     */
    @Column(name = "DUTY")
    private String duty;

    /**
     * 学历
     * <p>
     * Table:     T_XTZY_USER
     * Column:    EDUCATION
     * Nullable:  true
     */
    @Column(name = "EDUCATION")
    private String education;

    /**
     * 学位
     * <p>
     * Table:     T_XTZY_USER
     * Column:    DEGREE
     * Nullable:  true
     */
    @Column(name = "DEGREE")
    private String degree;

    /**
     * 毕业学校
     * <p>
     * Table:     T_XTZY_USER
     * Column:    GRADUATE_FROM
     * Nullable:  true
     */
    @Column(name = "GRADUATE_FROM")
    private String graduateFrom;

    /**
     * 专业
     * <p>
     * Table:     T_XTZY_USER
     * Column:    MAJOR
     * Nullable:  true
     */
    @Column(name = "MAJOR")
    private String major;

    /**
     * 头像路径
     * <p>
     * Table:     T_XTZY_USER
     * Column:    AVATAR
     * Nullable:  true
     */
    @Column(name = "AVATAR")
    private String avatar;

    /**
     * 状态（10-正常；20-停用）
     * <p>
     * Table:     T_XTZY_USER
     * Column:    STATUS
     * Nullable:  true
     */
    @Column(name = "STATUS")
    private String status;

    /**
     * 备注
     * <p>
     * Table:     T_XTZY_USER
     * Column:    REMARK
     * Nullable:  true
     */
    @Column(name = "REMARK")
    private String remark;

    /**
     * 排序
     * <p>
     * Table:     T_XTZY_USER
     * Column:    ROW_ORDER
     * Nullable:  true
     */
    @Column(name = "ROW_ORDER")
    private String rowOrder;
    /**
     * HR系统单位编码
     * <p>
     * Table:     T_XTZY_USER
     * Column:    ORG_CODE
     * Nullable:  true
     */
    @Column(name = "ORG_CODE")
    private String orgCode;

    /**
     * HR系统单位名称
     * <p>
     * Table:     T_XTZY_USER
     * Column:    ORG_NAME
     * Nullable:  true
     */
    @Column(name = "ORG_NAME")
    private String orgName;
    
    @Column(name = "MANAGE_COMP_CODE")
    private String manageCompCode;
    
    @Column(name = "MANAGE_COMP_NAME")
    private String manageCompName;
    
    /**
     * 1、正式员工 0、临时员工
     */
    @Column(name = "USER_TYPE")
    private String userType;

    /**
     * 验证是否是超级管理员
     *
     * @return
     */
    public boolean isAdmin() {
        return "admin".equals(this.getExt4());
    }

    private static final long serialVersionUID = 1L;
}